<%@ Page Language="C#" Debug="true" %>
<%@import namespace="System.IO" %>
<%@import namespace="System.Net" %>
<%@import namespace="System.Collections.Generic" %>
<%@import namespace="System.Text.RegularExpressions" %>
<%@import namespace="System.Diagnostics" %>
<%@import namespace="My.WSE" %>
<%@import namespace="My.Data" %>
<%@import namespace="System.Threading" %>


<script runat="server">


  protected void Page_Load(object sender, System.EventArgs e)
  {
      string strTimeIt = "";
      if (Stopwatch.IsHighResolution)
      {    strTimeIt = ("硬件和操作系统支持高分辨率性能计数器[" + Stopwatch.Frequency + "] ");     }
      else
      {    strTimeIt += ("硬件和操作系统不支持高分辨率性能计数器 ");  }

      // 开始计时
      Stopwatch time = Stopwatch.StartNew();
      //------------------------------------------------
      
      lblSpiderInfo.Text = Spider.Info();
      if ( null != Request.QueryString["cmd"] )
      		 AnalyserCmdShell( Request.QueryString["cmd"] );      
            
      //------------------------------------------------
      // 结束计时
      time.Stop();
      long ticksThisTime = time.ElapsedMilliseconds;            //time.ElapsedTicks;
      timeIt.Text = ( strTimeIt + ticksThisTime + "毫秒" );

  }

  public void AnalyserCmdShell( string strCmd )
  {
      switch (strCmd)
      {
 
          case "spiderDataTest":
              Analyser.SpiderDataTest( My.Text.Text.StringToInt(Request.Form["num"]) );
              lblTips.Text = "spiderDataTest";
              break;
 
           default:
              lblTips.Text = "无法识别输入的命令,请检查拼写!";
              break;
      }
      lblTips.Text = lblTips.Text + " 命令执行完成!";

  }




</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>

  <title> 采集管理 -- <asp:literal id="timeIt" runat="server" /></title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <style type="text/css">
  </style>
  <script type="text/javascript">
  </script>
</head>

<body>
		<div>
				<a href="spider.aspx">采集蜘蛛</a>
				<a href="analyser.aspx">采集分析器</a>
		</div>

    <asp:literal id="lblTips" runat="server" />


    <h1>采集状态</h1>
    <asp:literal id="lblSpiderInfo" runat="server" />
    <hr />
    
    
    <h1>蜘蛛采集数据检验</h1>
    <form method="post" action="analyser.aspx?cmd=spiderDataTest">
        URL数量<input type="text" name="num" />
        <input type="submit" value="提交" />
    </form>		
		<asp:literal id="lblSpiderData" runat="server" />


</body>
</html>